package cn.doit.richString

/**
  * Created by ZHAOXUHUA 
  * .           on 2018/11/28.
  */
class RichString(val str:String) {
  def toIntPlus = try {
    str.toInt
  } catch {
    case _: Exception => 0
  }

  def toDoublePlus = try {
    str.toDouble
  } catch {
    case _: Exception => 0d
  }
}

object RichString{
  implicit def str2RichString(str:String)=new RichString(str)
}
